var bed = world.querySelector('.床')
if (bed) {
    bed.enableInteract = true
    bed.interactRadius = 4
    bed.interactHint = '互动'

    bed.onInteract(async ({ entity }) => {
        if (entity.safe == 0) {
            entity.position.set(72, 10, 70)
            entity.safe = 1

        }
        else {
            entity.position.set(75, 12, 72)
            entity.safe = 0
        }
    })

    world.onPlayerJoin(async ({ entity }) => {
        entity.safe = 0
    })
}